import request from '/@/utils/request';

const workable_api = import.meta.env.VITE_WORKABLE_API as string;

/**
 * 获取执行计划管理列表
 * @param params 
 */
export function getWorkablePlanList(params?: object){
    return request({
        url: workable_api + '/plan/list',
        method: 'get',
        params: params
    })
}

/**
 * 获取执行计划
 * @param params 
 */
export function getWorkablePlan(params?: object){
    return request({
        url: workable_api + '/plan/info',
        method: 'get',
        params: params
    })
}

/** 新增执行计划 */
export function addWorkablePlan(params? : object){
    return request({
        url: workable_api + '/plan/add',
        method: 'post',
        data: params
    });
}

/** 修改执行计划 */
export function editWorkablePlan(params?: object) {
    return request({
        url: workable_api + '/plan/edit',
        method: 'post',
        data: params
    });
}

/** 删除执行计划 */
export function delWorkablePlan(params?: object){
    return request({
        url: workable_api + '/plan/remove',
        method: 'post',
        data: params
    });
}

/** 启动执行计划 */
export function startWorkablePlan(params?: object){
    return request({
        url: workable_api + '/plan/start',
        method: 'post',
        data: params
    });
}

/** 停止执行计划 */
export function stopWorkablePlan(params?: object){
    return request({
        url: workable_api + '/plan/stop',
        method: 'post',
        data: params
    });
}
